﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />

<div class="modal-dialog" role="document" style="width: 1200px;">
  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <h4 class="modal-title"><fmt:message key="assessor.64" /> <fmt:message key="assessor.456-1" /></h4>
    </div>
    <form class="form-horizontal" method="POST" action="${ctx.host}/sessions/${sessionCalibration.session.id}/supervisor-calibrations/${sessionCalibration.id}/edit-effective" data-validate="true">
      <input type="hidden" name="_method" value="PATCH">
      <div class="modal-body competency-box">
        <%-- <ul class="list-unstyled instruction-list">
          <li><fmt:message key="assessor.417" /><a href=""><fmt:message key="assessor.418" /></a></li>
          <li><fmt:message key="assessor.419" /></li>
        </ul> --%>
        <div style="height: 550px;overflow-y: scroll; margin-top: 30px;"">
          <c:forEach var="calibrationCompetencie" items="${sessionCalibrationCompetencies}">
          <div>
            <span class="color-erythrine" style="font-size: 20px; font-weight: bold;"><fmt:message key="${calibrationCompetencie.message}" /></span>
            <span class="color-erythrine" style="font-size: 14px; font-weight: bold;"><span class="color-${calibrationCompetencie.score.s ? 'bottle-green' : (calibrationCompetencie.score.c ? 'peak-green' : 'red')}"><fmt:message key="${calibrationCompetencie.score.message}"/> (${calibrationCompetencie.score.alias})</span></span>
          </div>
          <div class="clearfix">
            <div class="col-xs-6">
              <fmt:message key="assessor.455-2" />
            </div>
            <div class="col-xs-6">
              <fmt:message key="assessor.455-3" />
            </div>
          </div>
          <c:choose>
            <c:when test="${empty sessionReportWriting}">
              <div class="clearfix" style="border-bottom: 1px solid #C55A11; margin-bottom: 10px;">
                <input type="hidden" name="${calibrationCompetencie.nameAlias}Score" value="${calibrationCompetencie.score}">
                <div class="col-xs-6">
                  <div>
                    <textarea data-validate="required" name="${calibrationCompetencie.nameAlias}Strong" style="width: 100%;" rows="5">${calibrationCompetencie.effective}</textarea>
                  </div>
                </div>
                <div class="col-xs-6">
                  <div>
                    <textarea data-validate="required" name="${calibrationCompetencie.nameAlias}Weak" style="width: 100%;" rows="5">${calibrationCompetencie.inEffective}</textarea>
                  </div>
                </div>
              </div>
            </c:when>
            <c:otherwise>
              <div class="clearfix" style="border-bottom: 1px solid #C55A11; margin-bottom: 10px;">
                <input type="hidden" name="${calibrationCompetencie.nameAlias}Score" value="${calibrationCompetencie.score}">
                <div class="col-xs-6">
                  <div>
                    <textarea data-validate="required" name="${calibrationCompetencie.nameAlias}Strong" style="width: 100%;" rows="5"><c:set value="${sessionReportWriting.sessionReportCompetency.getEffecitve(calibrationCompetencie.name)}" var="effective"></c:set>${effective != null ? effective : calibrationCompetencie.effective}</textarea>
                  </div>
                </div>
                <div class="col-xs-6">
                  <div>
                    <textarea data-validate="required" name="${calibrationCompetencie.nameAlias}Weak" style="width: 100%;" rows="5"><c:set value="${sessionReportWriting.sessionReportCompetency.getInEffective(calibrationCompetencie.name)}" var="inEffective"></c:set>${inEffective != null ? inEffective : calibrationCompetencie.inEffective}</textarea>
                  </div>
                </div>
              </div>
            </c:otherwise>
          </c:choose>
          </c:forEach>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><fmt:message key="assessor.460" /></button>
        <button type="submit" class="btn btn-success" style="background: #70AD47;"><fmt:message key="assessor.462" /></button>
      </div>
    </form>
  </div>
</div>